package io.gitee.zicai.bus.bus;

import io.gitee.zicai.bus.core.IBusReceiver;

import java.util.function.BiConsumer;

/**
 * IReceiveBus
 *
 * @author zicai
 * @since 2021-01-18
 */
public interface IReceiveBus<R extends IBusReceiver, T> extends IBus<R, T> {

    @Override
    default T getPayload() {
        return getReceiveData();
    }

    @Override
    default BiConsumer<R, T> getBiConsumer() {
        return receive();
    }

    T getReceiveData();

    BiConsumer<R, T> receive();
}
